using System.Configuration;

namespace Wax.Provider
{
    /// <summary>
    /// Represents the Wax data provider configuration section in a configuration file. 
    /// </summary>
    public class WaxDataProviderConfiguration : ConfigurationSection
    {
        /// <summary>
        /// Gets a collection of <see cref="ProviderSettings" /> objects.
        /// </summary>
        /// <value>
        /// A collection of  <see cref="ProviderSettings" /> objects.
        /// </value>
        [ConfigurationProperty("providers")]
        public ProviderSettingsCollection Providers
        {
            get
            {
                return (ProviderSettingsCollection)base["providers"];
            }
        }

        /// <summary>
        /// Gets the default <see cref="WaxDataProviderBase">provider</see>.
        /// </summary>
        [ConfigurationProperty("defaultProvider", DefaultValue = "McmsProvider")]
        [StringValidator(MinLength = 1)]
        public string DefaultProvider
        {
            get
            {
                return (string)base["defaultProvider"];
            }
            set
            {
                base["defaultProvider"] = value;
            }
        }

    }
}